<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	</head>
	<body>
		<div id="view"></div>
	</body>
	<!-- 模板渲染 -->
	<script id="demo" type="text/html">
		{{#  layui.each(d.data, function(index, item){ }}
		  <div class="item">
			<div class="tit">
			<span><img src="lib/layui/images/face/0.gif" ></span>
			<!-- 床号 -->
			<span class="ch">{{item.bedCode}}</span>
			<!-- 姓名 -->
			<span class="name">{{item.patName}}</span>
			<!-- 年龄 -->
			<span class="bh">{{item.patAge}}</span>
			<!-- 护理等级 -->
			<span class="hldj">{{item.nursingLevel}}</span>
			</div>
			<div class="con clearfix">
				<div class="fl w55">
					<ul>
						<li><span>住院号：{{ item.admid }}</span></li>
						<li><span>入院：{{ item.admDate }}</span></li>
						<li><span>医生：{{ item.mainDoctor }}</span></li>
						<li><span>诊断：{{ item.diatag  }}</span></li>
					</ul>
				</div>
				<div class="fl w45">
					<ul>
						<li><span>总缴费：{{ item.total }}</span></li>
						<li><span>余额：{{ item.balance }}</span></li>
						<li><span>医保方式：{{ item.medicalType  }}</span></li>
					</ul>
				</div>
			</div>
			<div class="foot">
				<span>{{ item.illnessState }}</span>
			</div>
			 </div>
		  {{#  }); }}
		  {{#  if(d.data.length === 0){ }}
			无数据
		  {{#  } }}  
	</script>
	
	<script src="./js/jquery-3.3.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<!-- <script src="js/common.js" type="text/javascript" charset="utf-8"></script> -->
	<script src="js/global.js" type="text/javascript" charset="utf-8"></script>
	<script>
		$(document).ready(function() {
			console.log("1");
			layui.use(['layer', 'commons', 'form', 'laydate', 'element', 'table', 'laypage', 'laytpl'], function() {
				var layer = layui.layer,
					$ = layui.jquery,
					common = layui.commons,
					form = layui.form,
					laydate = layui.laydate,
					table = layui.table,
					laypage = layui.laypage,
					 laytpl = layui.laytpl,
						element = layui.element;
				common.ajax('http://192.168.0.100:8070/service-patient/patient/viewPatientList',
					JSON.stringify({
						"body": {
							"isHospital ": 1,
							"departmentId": "60",
							"patientName": "",
							"admid": "",
							"currPage": 2,
							"pageSize": 3
						},
						"header": {},
						"token": {}
					}),
					function(data) {
						console.log(data);
						var getTpl = demo.innerHTML,
							view = document.getElementById('view');
						laytpl(getTpl).render(data, function(html) {
							view.innerHTML = html;
						});
					},
					'post');
			})
		})
	</script>
</html>
